import pika

def ini_pika():
    credentials = pika.PlainCredentials('admin', '123456')
    connection = pika.BlockingConnection(
        pika.ConnectionParameters(host='192.168.0.64',port=5672,credentials=credentials, virtual_host = "picture")
    )
    return connection

def picture_msg_callback(ch, method, properties, body):
    print(f" [x] Received {body!r}")

if __name__ == '__main__':
    connection = ini_pika()
    channel = connection.channel()
    channel.basic_qos(prefetch_count=1)
    channel.basic_consume(queue='picture-queue', on_message_callback=picture_msg_callback)
    channel.start_consuming()